-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Darwin backwards-compat shims for the TestCluster rename. #23611
Merged
bzbarsky-apple
merged 1 commit into
project-chip:master
from
bzbarsky-apple:fix-up-darwin-testcluster
Nov 16, 2022
Merged
Add Darwin backwards-compat shims for the TestCluster rename. #23611
bzbarsky-apple
merged 1 commit into
project-chip:master
from
bzbarsky-apple:fix-up-darwin-testcluster
Nov 16, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
project-chip#23495 renamed "TestCluster" to "UnitTesting", which changed a bunch of Darwin APIs. This PR puts in place backwards-compat shims to avoid API changes. Specifically, compared to revision 9a41c9c (right before project-chip#23495 landed), the changes to Darwin code end up looking like this: 1. MTRAttributeTLVValueDecoder.mm: internal-only changes to cluster ids. 2. MTRBaseClusters.h: * MTRBaseClusterTestCluster renamed to MTRBaseClusterUnitTesting, which is marked MTR_NEWLY_AVAILABLE. * Various modifications to methods on MTRBaseClusterUnitTesting that are marked MTR_NEWLY_AVAILABLE, so these changes are OK. * MTRBaseClusterTestCluster is added as a subclass of MTRBaseClusterUnitTesting. * The MTRBaseClusterTestCluster (Deprecated) bits are not changed at all. * The MTRUnitTesting enums/bitmaps are added as MTR_NEWLY_AVAILABLE. * The MTRTestCluster enums/bitmaps are marked as MTR_NEWLY_DEPRECATED. 3. MTRBaseClusters.mm: The various (Deprecated) bits get shims on the completion handlers to handle the fact that for MTRBaseClusterTestCluster (Deprecated) the types in the completions are TestCluster but we want to call things that expect UnitTesting types, so we have to cast between them. We could restrict these shims to just TestCluster with enough work, but it does not seem worth it. 4. MTRBaseClusters_internal.h: just follows the renaming from MTRBaseClusters.h 5. MTRCallbackBridge.mm: just follows the renamings of the various struct types, commands, etc.. 6. MTRCallbackBridge_internal.h: just follows the renaming of the various struct types. 7. MTRClusterConstants.h: marks the old constants as MTR_NEWLY_DEPRECATED and adds the new constants as MTR_NEWLY_AVAILABLE. 8. MTRClusters.h: * MTRClusterTestCluster renamed to MTRClusterUnitTesting, which is marked MTR_NEWLY_AVAILABLE. * Various modifications to methods on MTRClusterUnitTesting that are marked MTR_NEWLY_AVAILABLE, so these changes are OK. * MTRClusterTestCluster is added as a subclass of MTRClusterUnitTesting. * The MTRClusterTestCluster (Deprecated) bits are not changed at all. 9. MTRClusters.mm: The various (Deprecated) bits get shims on the completion handlers, like for MTRBaseClusters.mm above. 10. MTRClusters_internal.h: Just follows the renaming from MTRClusters.h 11. MTRCommandPayloadsObjc.h: * Renames payload structs to UnitTesting, marks them MTR_NEWLY_AVAILABLE * Adds subclasses of the payload structs with the old name that are marked as MTR_NEWLY_DEPRECATED and have no extra selectors. * Changes types of struct members of payloads to have the UnitTesting types. 12. MTRCommandPayloadsObjc.mm: just follows the header changes. 13. MTREventTLVValueDecoder.mm: Internal changes to ID names. 14. MTRStructsObjc.h: * Renames structs defined in the unit testing cluster to UnitTesting names, marks them MTR_NEWLY_AVAILABLE. * Adds subclasses of the structs with the old name that are marked as MTR_NEWLY_DEPRECATED and have no extra selectors. 15. MTRStructsObjc.mm: just follows the header changes.
pullapprove
bot
requested review from
andy31415,
anush-apple,
arkq,
Byungjoo-Lee,
carol-apple,
chrisdecenzo,
chshu,
chulspro,
Damian-Nordic,
dhrishi,
electrocucaracha,
emargolis,
franck-apple,
gjc13,
harimau-qirex,
harsha-rajendran,
hawk248,
isiu-apple,
jelderton,
jepenven-silabs,
jmartinez-silabs,
jtung-apple,
kghost,
kpschoedel,
lazarkov,
LuDuda,
mlepage-google and
msandstedt
November 15, 2022 14:43
pullapprove
bot
requested review from
mspang,
robszewczyk,
saurabhst,
selissia,
tcarmelveilleux,
tecimovic,
vijs,
vivien-apple,
wbschiller,
woody-apple,
xylophone21 and
yufengwangca
November 15, 2022 14:44
PR #23611: Size comparison from 6519b91 to 459e584 Increases (3 builds for esp32, telink)
Decreases (9 builds for bl602, esp32, psoc6, qpg, telink)
Full report (51 builds for bl602, bl702, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
jtung-apple
approved these changes
Nov 16, 2022
Fast-tracking platform-specific change with platform owner review. |
adbridge
pushed a commit
to ARM-software/connectedhomeip
that referenced
this pull request
Nov 18, 2022
…t-chip#23611) project-chip#23495 renamed "TestCluster" to "UnitTesting", which changed a bunch of Darwin APIs. This PR puts in place backwards-compat shims to avoid API changes. Specifically, compared to revision 9a41c9c (right before project-chip#23495 landed), the changes to Darwin code end up looking like this: 1. MTRAttributeTLVValueDecoder.mm: internal-only changes to cluster ids. 2. MTRBaseClusters.h: * MTRBaseClusterTestCluster renamed to MTRBaseClusterUnitTesting, which is marked MTR_NEWLY_AVAILABLE. * Various modifications to methods on MTRBaseClusterUnitTesting that are marked MTR_NEWLY_AVAILABLE, so these changes are OK. * MTRBaseClusterTestCluster is added as a subclass of MTRBaseClusterUnitTesting. * The MTRBaseClusterTestCluster (Deprecated) bits are not changed at all. * The MTRUnitTesting enums/bitmaps are added as MTR_NEWLY_AVAILABLE. * The MTRTestCluster enums/bitmaps are marked as MTR_NEWLY_DEPRECATED. 3. MTRBaseClusters.mm: The various (Deprecated) bits get shims on the completion handlers to handle the fact that for MTRBaseClusterTestCluster (Deprecated) the types in the completions are TestCluster but we want to call things that expect UnitTesting types, so we have to cast between them. We could restrict these shims to just TestCluster with enough work, but it does not seem worth it. 4. MTRBaseClusters_internal.h: just follows the renaming from MTRBaseClusters.h 5. MTRCallbackBridge.mm: just follows the renamings of the various struct types, commands, etc.. 6. MTRCallbackBridge_internal.h: just follows the renaming of the various struct types. 7. MTRClusterConstants.h: marks the old constants as MTR_NEWLY_DEPRECATED and adds the new constants as MTR_NEWLY_AVAILABLE. 8. MTRClusters.h: * MTRClusterTestCluster renamed to MTRClusterUnitTesting, which is marked MTR_NEWLY_AVAILABLE. * Various modifications to methods on MTRClusterUnitTesting that are marked MTR_NEWLY_AVAILABLE, so these changes are OK. * MTRClusterTestCluster is added as a subclass of MTRClusterUnitTesting. * The MTRClusterTestCluster (Deprecated) bits are not changed at all. 9. MTRClusters.mm: The various (Deprecated) bits get shims on the completion handlers, like for MTRBaseClusters.mm above. 10. MTRClusters_internal.h: Just follows the renaming from MTRClusters.h 11. MTRCommandPayloadsObjc.h: * Renames payload structs to UnitTesting, marks them MTR_NEWLY_AVAILABLE * Adds subclasses of the payload structs with the old name that are marked as MTR_NEWLY_DEPRECATED and have no extra selectors. * Changes types of struct members of payloads to have the UnitTesting types. 12. MTRCommandPayloadsObjc.mm: just follows the header changes. 13. MTREventTLVValueDecoder.mm: Internal changes to ID names. 14. MTRStructsObjc.h: * Renames structs defined in the unit testing cluster to UnitTesting names, marks them MTR_NEWLY_AVAILABLE. * Adds subclasses of the structs with the old name that are marked as MTR_NEWLY_DEPRECATED and have no extra selectors. 15. MTRStructsObjc.mm: just follows the header changes.
adbridge
pushed a commit
to ARM-software/connectedhomeip
that referenced
this pull request
Nov 18, 2022
…t-chip#23611) project-chip#23495 renamed "TestCluster" to "UnitTesting", which changed a bunch of Darwin APIs. This PR puts in place backwards-compat shims to avoid API changes. Specifically, compared to revision 9a41c9c (right before project-chip#23495 landed), the changes to Darwin code end up looking like this: 1. MTRAttributeTLVValueDecoder.mm: internal-only changes to cluster ids. 2. MTRBaseClusters.h: * MTRBaseClusterTestCluster renamed to MTRBaseClusterUnitTesting, which is marked MTR_NEWLY_AVAILABLE. * Various modifications to methods on MTRBaseClusterUnitTesting that are marked MTR_NEWLY_AVAILABLE, so these changes are OK. * MTRBaseClusterTestCluster is added as a subclass of MTRBaseClusterUnitTesting. * The MTRBaseClusterTestCluster (Deprecated) bits are not changed at all. * The MTRUnitTesting enums/bitmaps are added as MTR_NEWLY_AVAILABLE. * The MTRTestCluster enums/bitmaps are marked as MTR_NEWLY_DEPRECATED. 3. MTRBaseClusters.mm: The various (Deprecated) bits get shims on the completion handlers to handle the fact that for MTRBaseClusterTestCluster (Deprecated) the types in the completions are TestCluster but we want to call things that expect UnitTesting types, so we have to cast between them. We could restrict these shims to just TestCluster with enough work, but it does not seem worth it. 4. MTRBaseClusters_internal.h: just follows the renaming from MTRBaseClusters.h 5. MTRCallbackBridge.mm: just follows the renamings of the various struct types, commands, etc.. 6. MTRCallbackBridge_internal.h: just follows the renaming of the various struct types. 7. MTRClusterConstants.h: marks the old constants as MTR_NEWLY_DEPRECATED and adds the new constants as MTR_NEWLY_AVAILABLE. 8. MTRClusters.h: * MTRClusterTestCluster renamed to MTRClusterUnitTesting, which is marked MTR_NEWLY_AVAILABLE. * Various modifications to methods on MTRClusterUnitTesting that are marked MTR_NEWLY_AVAILABLE, so these changes are OK. * MTRClusterTestCluster is added as a subclass of MTRClusterUnitTesting. * The MTRClusterTestCluster (Deprecated) bits are not changed at all. 9. MTRClusters.mm: The various (Deprecated) bits get shims on the completion handlers, like for MTRBaseClusters.mm above. 10. MTRClusters_internal.h: Just follows the renaming from MTRClusters.h 11. MTRCommandPayloadsObjc.h: * Renames payload structs to UnitTesting, marks them MTR_NEWLY_AVAILABLE * Adds subclasses of the payload structs with the old name that are marked as MTR_NEWLY_DEPRECATED and have no extra selectors. * Changes types of struct members of payloads to have the UnitTesting types. 12. MTRCommandPayloadsObjc.mm: just follows the header changes. 13. MTREventTLVValueDecoder.mm: Internal changes to ID names. 14. MTRStructsObjc.h: * Renames structs defined in the unit testing cluster to UnitTesting names, marks them MTR_NEWLY_AVAILABLE. * Adds subclasses of the structs with the old name that are marked as MTR_NEWLY_DEPRECATED and have no extra selectors. 15. MTRStructsObjc.mm: just follows the header changes.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#23495 renamed "TestCluster"
to "UnitTesting", which changed a bunch of Darwin APIs. This PR puts in place
backwards-compat shims to avoid API changes. Specifically, compared to revision
9a41c9c (right before #23495 landed), the
changes to Darwin code end up looking like this:
marked MTR_NEWLY_AVAILABLE.
marked MTR_NEWLY_AVAILABLE, so these changes are OK.
MTRBaseClusterUnitTesting.
completion handlers to handle the fact that for MTRBaseClusterTestCluster
(Deprecated) the types in the completions are TestCluster but we want to
call things that expect UnitTesting types, so we have to cast between them.
We could restrict these shims to just TestCluster with enough work, but it
does not seem worth it.
commands, etc..
struct types.
adds the new constants as MTR_NEWLY_AVAILABLE.
MTR_NEWLY_AVAILABLE.
MTR_NEWLY_AVAILABLE, so these changes are OK.
completion handlers, like for MTRBaseClusters.mm above.
are marked as MTR_NEWLY_DEPRECATED and have no extra selectors.
marks them MTR_NEWLY_AVAILABLE.
MTR_NEWLY_DEPRECATED and have no extra selectors.